(1) Field of the Invention
The present invention relates to a relational database synchronization method, and more particularly, to a relational database synchronization method for synchronizing data of a relational database held by a master machine with duplications of the same data held by replica machines, which are usually operated in a manner disconnected from the master machine, so that there may be no inconsistency among the data.
(2) Description of the Related Art
Recently, in mobile computing environments, software for use in the field called SFA (Sales Force Automation) has been proposed whereby data about customers is stored in portable information terminals, such as notebook computers, hand-held computers, PDAs (Personal Digital Assistants), etc., and is utilized to increase the chance of success in negotiations, thereby promoting business activities.
In ordinary client/server network environments, a database is used in such a manner that clients access a database server. If, however, the number of accesses from clients is large, the load on the server increases, causing a delay in responding to the clients"" requests. In order to enhance the server capabilities and thereby eliminate such a situation, in general, a plurality of servers are provided, thereby distributing the load on the server.
In this case, a server as a master and servers as slaves hold respective log files indicative of their status, so as to manage differentials among master data of the master server and duplications (replicas) of the master data held by the respective slave servers. The master server has as many log files as the number of slave servers, and each slave server has a log file for the master server.
If any one of the servers has updated its data, synchronization of the servers, that is, replication, is performed so that the latest data may be held by all servers. In order to carry out the replication, data write into the databases held by the master and slave servers is inhibited, and with accesses from clients stopped, the log files are exchanged. Since the replication needed for all slaves is proportional in number to the slave servers, such replication is executed strictly according to schedule.
In a mobile computing environment, on the other hand, a server holding master data of a relational database and portable information terminals each holding a replica of the master data are interconnected via a network; however, the connection of each portable information terminal to the server is not permanent, that is, the terminal is connected at an arbitrary point of time and is disconnected after an arbitrary interval of time. Accordingly, the replication of data between the server and each portable information terminal is performed when the portable information terminal is connected to the server, unlike the replication among servers in a client/server system.
Thus, the procedure for replication among servers employed in client/server systems cannot be applied to cases where there are more than several tens of replicas, each portable information terminal holding the replica is connected to the network at an arbitrary point of time and is disconnected therefrom after an arbitrary interval of time, and synchronization between the replica and the master data is performed for each of computers at an arbitrary time.
Specifically, in a client/server system, replicas are used for the purpose of load distribution; therefore, the number of replicas is not very large, and this is the case with the number of log files for the management of differentials among the master data and its replicas. If, however, there are several tens or even several hundreds of replicas, the number of log files that need to be held by the server increases correspondingly, requiring a large disk capacity to store the log files, so that it is not practical to construct such a system.
Also, in a client/server system, replication is performed among the master server and the slave servers strictly according to schedule and the time required to complete the synchronization for all replicas is proportional to the number of replicas; therefore, in an operational environment in which the number of replicas is extremely large, restrictions are imposed on the system operation, for example, the intended performance cannot be achieved.
Further, where an identical record has been updated, there inevitably occurs update contention when the updated data are reflected in the master data. In the case of operation in which data is updated at arbitrary timing, however, data update is not performed sequentially in time and the problem of update contention remains unsolved, impeding normal operation.
In addition, when update contention has occurred in the replication among servers, the only available method for solution is to give priority to the master or to the replica, posing a problem that it is impossible to collect and distribute the current latest and correct data.
An object of the present invention is to provide a relational database synchronization method for synchronizing data of a relational database held by a master machine with duplications of the same data held by replica machines which are usually operated in a manner disconnected from the master machine.
To achieve the above object, there is provided a relational database synchronization method for synchronizing master data of a relational database held by a master machine with replica data which is a duplication of the master data and is held by each of a large number of replica machines, wherein each replica machine usually operates using the replica data while in an off-line state with respect to the master machine. The relational database synchronization method comprises the step of connecting a replica machine to the master machine at an arbitrary time to make a request for synchronization, the step of extracting, in the replica machine, a record of which a day of last update is later than a master differential extraction completion time, from the replica data as a replica differential, the step of transferring the extracted replica differential to the master machine, the step of extracting, in the master machine, a record of which a replica differential reflection time is later than a master differential extraction completion time, as a master differential from the master data with reference to records held by the replica machine which has made the request for synchronization, and updating the master differential extraction completion time to a current time, the step of causing the replica differential to be reflected in the master data, the step of transferring the master differential and the updated master differential extraction completion time to the replica machine, the step of causing the master differential transferred from the master machine to be reflected in the replica data in the replica machine and updating the master differential extraction completion time held by the replica machine to the transferred master differential extraction completion time, and the step of cutting of f the connection between the replica machine and the master machine.
The above and other objects, features and advantages of the present invention will become apparent from the following description when taken in conjunction with the accompanying drawings which illustrate preferred embodiments of the present invention by way of example.